//
//  genderChooseCell.m
//  LoveFreshBeen
//
//  Created by 胡不归是大虾 on 2016/10/21.
//  Copyright © 2016年 魏根. All rights reserved.
//

#import "genderChooseCell.h"
#import "MyAdressModel.h"
@interface genderChooseCell( )
@property (weak, nonatomic) IBOutlet UIButton *maleBtn;
@property (weak, nonatomic) IBOutlet UIButton *femaleBtn;



@end
@implementation genderChooseCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)didChooseGender:(UIButton *)sender {
    if (sender.tag == 10) {
        self.maleBtn.selected = YES;
        self.femaleBtn.selected = NO;
        self.model.gender = @"1";
    }
    else{
        self.maleBtn.selected = NO;
        self.femaleBtn.selected = YES;
        self.model.gender = @"0";
    }
}
-(void)setModel:(MyAdressModel *)model{
    _model = model;
    if (model.accept_name != nil) {
        if ([model.gender intValue] == 1) {
            self.maleBtn.selected = YES;
        }else{
            self.femaleBtn.selected = YES;
        }
    }
}
@end
